home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / camera.h < prev    next >
Text File  |  1993-09-23  |  1KB  |  46 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *    FILE:        camera.h
  5. *    AUTHOR:        R. Gonzalez
  6. *    CREATED:    October 2, 1990
  7. *
  8. *    Defines camera (parameters for 3D projection) for the picture
  9. *    application.
  10. */
  11.  
  12. # ifndef    camera_h
  13. # define    camera_h
  14.  
  15. # include    "class.h"
  16. # include    "coord.h"
  17. # include    "trans.h"
  18.  
  19. /******************************************************************
  20. *   camera class.  The camera's location is given in world
  21. *    coordinates.  If you were to translate the camera to the
  22. *    origin of the world coordinate system, then (1) yaw is the angle
  23. *    the camera is pointing as rotated about the world's vertical
  24. *    (y) axis (with respect to the direction of the world z axis);
  25. *    (2) pitch is the angle it is pointing with respect to the world
  26. *    horizontal (x-z) plane; (3) roll is the angle the camera's "up"
  27. *    direction makes from the world's y axis, as measured about the
  28. *    axis in which the camera is pointing.  Note that yaw and roll
  29. *    are undefined when pitch is PI/2 or -PI/2; i.e., when the
  30. *    camera points straight up or down.
  31. ******************************************************************/
  32. class    Camera:public Generic_Class
  33. {
  34. private:
  35.     World_To_Camera    *world_to_camera;
  36.     double            focal_length;
  37.     
  38. public:
  39.     Camera(void);
  40.     virtual void    set_position(double,double,double,double,double,double);
  41.     virtual void    set_focal_length(double);
  42.     virtual boolean    take_photo(Coord2*,Coord3*);
  43.     virtual            ~Camera(void);
  44. };
  45.  
  46. # endif